API Docs for: 1.0.0
Show:

TYRO.IClientEmbedded Class

Module: TYRO

Overview

The embedded API provides integration with Tyro terminals for mobile environments, for example the Tyro iClient Adapter for iOS.

For iOS

To integrate with Tyro devices you will need to include the provided Tyro iOS iClient Adapter in your application.

Constructor

TYRO.IClientEmbedded

(
  • apiKey
  • posProductData
  • [integratedReceipt]
  • [integratedReceiptWidth]
  • [mid]
  • [tid]
)

Parameters:

  • apiKey String

    The API key provided by Tyro.

  • posProductData Object

    An object containing the following properties (check with Tyro in case of any questions):

    • posProductVendor String

      Name of your company.

    • posProductName String

      Name of your product.

    • posProductVersion String

      Version of your product.

  • [integratedReceipt] String optional

    Whether receipts will be printed on the POS (true) or on the terminal (false).

  • [integratedReceiptWidth] String optional

    The number of characters that fit the width of your receipt paper, so we can align the text nicely.

  • [mid] Int optional

    Override the configured mid for multi-merchant terminals.

  • [tid] Int optional

    Override the configured tid for multi-merchant terminals.

Example:

// iOS
TyroClient client = [[TyroClient alloc] initWithWebView: webView
                                        webViewDelegate: webViewDelegate
                                                 apiKey: @"secretKey"
                                       posProductVendor: @"Name of your company"
                                         posProductName: @"Name of your product"
                                      posProductVersion: @"Version of your product"];

// Optional: Connect to a test simulator that does not require a physical terminal
client.baseUrl = @"https://iclientsimulator.test.tyro.com";

// Optional: Connect to a test system that can only be used with a physical terminal
client.baseUrl = @"https://iclient.test.tyro.com";

Methods

addTip

(
  • completionReference
  • tipAmount
)

Add a tip to a previous purchase (initiatePurchase).

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

  • tipAmount String

    The tip amount to add in cents.

Example:

// iOS
Not supported

closeTab

(
  • completionReference
  • amount
)

Close a previously opened bar tab with a final amount. The customer will be charged.

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

  • amount String

    The final amount to charge the customer.

Example:

// iOS
[self.client performOperation: @"closeTab"
                   parameters: @{@"amount" : @"12000",
                                 @"completionReference" : @"439440"}
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

completePreAuth

(
  • requestParams
)

Close a previously opened preAuth with a final amount. The customer will be charged.

Parameters:

  • requestParams Object

    An object containing the following properties:

    • completionReference String

      Transaction identifier from the original transaction.

    • amount String

      The final amount to charge the customer.

    • [integrationKey] String optional

      Supply the integration key if your browser does not support local storage.

    • [mid] Int optional

      Override the configured mid for multi-merchant terminals.

    • [tid] Int optional

      Override the configured tid for multi-merchant terminals.

Example:

// iOS
[self.client performOperation: @"completePreAuth"
                   parameters: @{@"completionReference" : @"439440",
                   @"amount" : @"12000",
                   @"integrationKey" : @"ABC123",
                   @"mid" : @"1",
                   @"tid" : @"2"}
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

continueLastTransaction

()

Tell the terminal to continue last transaction

Example:

// iOS
[self.client performOperation: @"continueLastTransaction"
      receiptReceivedCallback: ^(NSDictionary *result) {NSLog(@"Receipt received: %@", result);}
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

easyclaim

(
  • type
  • payload
  • rightsAssigned
)

Tell the terminal to start a bulk billed Easyclaim request.

Parameters:

  • type String

    One of "bulkbill", "partpaid" or "fullypaid".

  • payload String

    The Easyclaim payload that is forwarded to Medicare.

  • rightsAssigned Boolean

    Whether rights have already been assigned for bulk bill claims

Example:

// iOS
[self.client performOperation: @"easyclaim"
                   parameters: @{@"type" : @"fullypaid",
                                 @"rightsAssigned" : @"true",
                                 @"payload" : @"<ns1:patienteClaimingRequest>...</ns1:patienteClaimingRequest>"}
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

healthpointCancel

(
  • providerId
  • serviceType
  • claimItemsCount
  • totalClaimAmount
  • claimItems
  • refTag
)

Tell the terminal to cancel a completed HealthPoint claim.

Parameters:

  • providerId String

    The 8 character id of the provider attending the patient.

  • serviceType String

    The 1 alphabetic character representing the category of service.

  • claimItemsCount String

    The total number of claim items.

  • totalClaimAmount Int

    The total amount of all claim items in cents.

  • claimItems String

    A List> of claim items.

  • refTag String

    The reference tag returned in the original claim's final transaction status response.

Example:

// iOS
[self.client performOperation: @"healthpointCancel"
                   parameters: @{
                       @"providerId" : @"2147661H",
                       @"serviceType" : @"D",
                       @"refTag" : @"123456",
                       @"claimItemsCount" : @"2",
                       @"totalClaimAmount" : @"300",
                       @"claimItems": @[
                           @{
                               @"claimAmount" : @"100",
                               @"serviceCode" : @"00001",
                               @"description" : @"SKULL XRAY",
                               @"serviceReference" : @"01",
                               @"patientId" : @"01",
                               @"serviceDate" : @"20131010"
                           },
                           @{
                               @"claimAmount" : @"200",
                               @"serviceCode" : @"00002",
                               @"description" : @"TEETH WHITENING",
                               @"serviceReference" : @"01",
                               @"patientId" : @"01",
                               @"serviceDate" : @"20131010"
                           }
                       ]
                   }
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) { NSLog(@"Transaction complete: %@", result); }];

healthpointClaim

(
  • providerId
  • serviceType
  • claimItemsCount
  • totalClaimAmount
  • claimItems
)

Tell the terminal to start a HealthPoint claim.

Parameters:

  • providerId String

    The 8 character id of the provider attending the patient.

  • serviceType String

    The 1 alphabetic character representing the category of service.

  • claimItemsCount String

    The total number of claim items.

  • totalClaimAmount Int

    The total amount of all claim items in cents.

  • claimItems String

    A List> of claim items.

Example:

// iOS
[self.client performOperation: @"healthpointClaim"
                   parameters: @{
                        @"providerId" : @"2147661H",
                        @"serviceType" : @"D",
                        @"claimItemsCount" : @"2",
                        @"totalClaimAmount" : @"300",
                        @"claimItems": @[
                            @{
                                @"claimAmount" : @"100",
                                @"serviceCode" : @"00001",
                                @"description" : @"SKULL XRAY",
                                @"serviceReference" : @"01",
                                @"patientId" : @"01",
                                @"serviceDate" : @"20131010"
                            },
                            @{
                                @"claimAmount" : @"200",
                                @"serviceCode" : @"00002",
                                @"description" : @"TEETH WHITENING",
                                @"serviceReference" : @"01",
                                @"patientId" : @"01",
                                @"serviceDate" : @"20131010"
                            }
                        ]
                  }
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) { NSLog(@"Transaction complete: %@", result); }];

healthpointReconciliationReport

(
  • reconDate
  • reportType
)

Retrieve a payments or claims HealthPoint reconciliation report.

Parameters:

  • reconDate String

    The reporting date in format yyyyMMdd.

  • reportType String

    The report type. Valid values are payments and claims.

Example:

// iOS
[self.client performOperation: @"healthpointReconciliationReport"
                   parameters: @{
                        @"reconDate" : @"20120129",
                        @"reportType" : @"payments"
                   }
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

incrementPreAuth

(
  • completionReference
  • amount
  • [integrationKey]
  • [mid]
  • [tid]
  • [transactionId]
)

Tell Tyro to increment a previously opened preAuth transaction.

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

  • amount String

    The incremental amount to increment the pre-auth amount.

  • [integrationKey] String optional

    Supply the integration key if your browser does not support local storage.

  • [mid] Int optional

    Override the configured mid for multi-merchant terminals.

  • [tid] Int optional

    Override the configured tid for multi-merchant terminals.

  • [transactionId] String optional

    The integrated transactionId.

Example:

// iOS
[self.client performOperation: @"incrementPreAuth"
                   parameters: @{@"completionReference" : @"439440",
                   @"amount" : @"12000",
                   @"integrationKey" : @"ABC123",
                   @"mid" : @"1",
                   @"tid" : @"2"}];

manualSettlement

()

Manually settle the terminal: close off reporting for the day.

Example:

// iOS
[self.client performOperation: @"manualSettlement"
                   parameters: nil
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

openPreAuth

(
  • amount
)

Tell the terminal to start an open preAuth transaction.

Parameters:

  • amount String

    The preAuth limit (maximum amount to charge the customer) in cents.

Example:

// iOS
[self.client performOperation: @"openPreAuth"
                   parameters: @{@"amount" : @"12000"}
      receiptReceivedCallback: ^(NSDictionary *result) {NSLog(@"Receipt received: %@", result);}
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

openTab

(
  • amount
)

Tell the terminal to start an open tab transaction.

Parameters:

  • amount String

    The tab limit (maximum amount to charge the customer) in cents.

Example:

// iOS
[self.client performOperation: @"openTab"
                   parameters: @{@"amount" : @"12000"}
      receiptReceivedCallback: ^(NSDictionary *result) {NSLog(@"Receipt received: %@", result);}
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

purchase

(
  • amount
  • [cashout]
  • [healthpointTransactionId]
)

Tell the terminal to start a purchase transaction.

Parameters:

  • amount String

    The purchase amount (amount to charge the customer) in cents.

  • [cashout] String optional

    Cash out amount in cents.

  • [healthpointTransactionId] String optional

    The integrated transaction ID of the original HealthPoint Claim (used for gap payments).

Example:

// iOS
[self.client performOperation: @"purchase"
                   parameters: @{@"amount" : @"12000"}
      receiptReceivedCallback: ^(NSDictionary *result) {NSLog(@"Receipt received: %@", result);}
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

reconciliationReport

(
  • terminalBusinessDay
  • reportType
  • reportFormat
  • integrationKey
  • [mid]
  • [tid]
)

Retrieve a summary or detail reconciliation report.

Parameters:

  • terminalBusinessDay String

    The reporting date in format yyyyMMdd.

  • reportType String

    The report type. Valid values are summary and detail.

  • reportFormat String

    The report format. Valid values are txt and xml. The txt version is pre-formatted in a monospaced font.

  • integrationKey String

    Supply the integration key if your browser does not support local storage.

  • [mid] Int optional

    Override the configured mid for multi-merchant terminals.

  • [tid] Int optional

    Override the configured tid for multi-merchant terminals.

Example:

// iOS
[self.client performOperation: @"reconciliationReport"
                   parameters: @{@"terminalBusinessDay" : @"20120129",
                                 @"reportFormat": @"txt",
                                 @"reportType": @"summary"}
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

refund

(
  • amount
)

Tell the terminal to start a refund transaction.

Parameters:

  • amount String

    The refund amount (amount to be given to the customer) in cents.

Example:

// iOS
[self.client performOperation: @"refund"
                   parameters: @{@"amount" : @"12000"}
      receiptReceivedCallback: ^(NSDictionary *result) {NSLog(@"Receipt received: %@", result);}
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

voidPreAuth

(
  • requestParams
  • completionReference
)

Void a previously opened preAuth (initiateOpenPreAuth). This discards the hold on funds in the customer's account.

Parameters:

  • requestParams Object

    An object containing the following properties:

    • [integrationKey] String optional

      Supply the integration key if your browser does not support local storage.

    • [mid] Int optional

      Override the configured mid for multi-merchant terminals.

    • [tid] Int optional

      Override the configured tid for multi-merchant terminals.

  • completionReference String

    Transaction identifier from the original transaction.

Example:

// iOS
[self.client performOperation: @"voidPreAuth"
                    parameters: @{@"completionReference" : @"439440",
                    @"integrationKey" : @"ABC123",
                    @"mid" : @"1",
                    @"tid" : @"2"}
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];

voidTab

(
  • completionReference
)

Void a previously opened bar tab (initiateOpenTab). This discards the hold on funds in the customer's account.

Parameters:

  • completionReference String

    Transaction identifier from the original transaction.

Example:

// iOS
[self.client performOperation: @"voidTab"
                   parameters: @{@"completionReference" : @"439440"}
      receiptReceivedCallback: nil
  transactionCompleteCallback: ^(NSDictionary *result) {NSLog(@"Transaction complete: %@", result);}];